package com.cn.front.controller;

import com.cn.common.pojo.ResultModel;
import com.cn.front.feign.NewsForHomeFeign;
import com.cn.front.feign.ProjectFeign;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping("project")
public class ProjectController {
    @Autowired
    ProjectFeign projectFeign;

//    @Autowired
//    NItemFeign nItemFeign;
    @RequestMapping("pByType")
    public ResultModel pByType(int type){
        ResultModel model = projectFeign.pByType(type);
        return model;
    }
    @RequestMapping("Item")
    public Map news(){
        Map map = new HashMap<>();
        map.put("item",projectFeign.item());
        map.put("project",projectFeign.pForP());
        return map;
    }
    @RequestMapping("pForId")
    public ResultModel newsForId(int id){

        return projectFeign.pForId(id);
    }
}
